package com.sugon.service.impl;

import cn.hutool.core.util.RandomUtil;
import com.sugon.dao.StorePositionDao;
import com.sugon.entity.StorePositionEntity;
import com.sugon.service.StorePositionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 仓库位置Service实现类
 *
 * @author sugon
 * @date 2019-07-12 10:03:02
 */
@Service("storePositionService")
public class StorePositionServiceImpl implements StorePositionService {
    @Autowired
    private StorePositionDao storePositionDao;

    @Override
    public StorePositionEntity queryObject(String id) {
        return storePositionDao.queryObject(id);
    }

    @Override
    public List<StorePositionEntity> queryList(Map<String, Object> map) {
        return storePositionDao.queryList(map);
    }

    @Override
    public int queryTotal(Map<String, Object> map) {
        return storePositionDao.queryTotal(map);
    }

    @Override
    public int save(StorePositionEntity storePosition) {
        storePosition.setId(RandomUtil.randomString(32));
        return storePositionDao.save(storePosition);
    }

    @Override
    public int update(StorePositionEntity storePosition) {
        return storePositionDao.update(storePosition);
    }

    @Override
    public int delete(String id) {
        return storePositionDao.delete(id);
    }

    @Override
    public int deleteBatch(String[] ids) {
        return storePositionDao.deleteBatch(ids);
    }
}
